import axios from 'axios'
import qs from 'qs'

export function toError(err) {
	if (process.env.NODE_ENV === 'development') {
		console.error(err)
	} else {
		const config = {
			content: err
		}
		axios
			.post(
				'http://175.6.46.236:8021/cs12345/FileController/recordFrontLog',
				qs.stringify(config)
			)
			.then((response) => {
				console.log(response)
			})
			.catch((error) => {
				console.log(error)
			})
	}
}
